package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.heima.pojo.SkuClass;
import com.heima.pojo.dto.SkuClassDto;
import com.heima.pojo.vo.SkuClassVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

/**
 * @author 赵超
 */
@Mapper
public interface SkuClassMapper extends BaseMapper<SkuClass> {
    Page<SkuClassVo> page(String className);

    @Select("select * from tb_sku_class where class_id = #{classId}")
    SkuClass getSkuClassByClassId(Integer classId);

    Integer updateSkuClassByClassId(SkuClass skuClass);

    Integer insertSkuClass(SkuClass skuClass);

    @Delete("delete from tb_sku_class where class_id = #{classId}")
    void deleteByClassId(Integer classId);
}
